package com.cedric.yixianpai.game.cards.Sects.swordCards.e_HuaShen;

import com.cedric.yixianpai.game.Constants.CardType;
import com.cedric.yixianpai.game.Constants.Period;
import com.cedric.yixianpai.game.Status.DuelStatus;
import com.cedric.yixianpai.game.interfaces.SwordCard;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class Kuang_0 extends SwordCard {
    private final int amplitude;//击伤恢复生命幅度
    /**
     * title:狂剑·零式
     * effect:持续：用狂剑击伤对方时恢复击伤30/50/70%的生命
     */
    public Kuang_0(@Value("1") int lvl) {
        super("狂剑·零式");
        this.setLevel(lvl);
        this.setCardType(CardType.KUANG);
        this.setPeriod(Period.HUASHEN);
        this.setDescription("持续：用狂剑击伤对方时恢复击伤30/50/70%的生命");
        this.setSustained();

        if (1 == lvl) {
            this.amplitude=30;
        } else if (2 == lvl) {
            this.amplitude=50;
        } else if (3 == lvl) {
            this.amplitude=70;
        } else {
            throw new RuntimeException("Card Level Error!");
        }
    }

    @Override
    public boolean effect(DuelStatus Sta1, DuelStatus Sta2) {
        Sta1.getPlayerBuff().addKuang_Vampire(this.amplitude);
        return false;
    }
}
